﻿#include<iostream>
using namespace std;
int main() {
	int x;
	cin >> x;
	int* p = (int*)malloc(x * sizeof(int));

	p[0] = 250;
	free(p); //接下来继续用该指针的话不会报错
	//p[2] = 255;

	int* pa = new int[100];
	int* pold = pa;
	pa[0] = 1;
	delete[] p;//接下来继续用该指针的话会报错
	pold[0] = 100;//这里用了该指针
	p[0] = 2;
}